package main

func scoreOfString(s string) int {
	sum := 0
	for i := 0; i+1 < len(s); i++ {
		if s[i+1] > s[i] {
			sum += int(s[i+1] - s[i])
		} else {
			sum += int(s[i] - s[i+1])
		}
	}
	return sum
}

func main() {
	println(scoreOfString("hello"))
}